/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jeff.springWebTestNG.tx;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 *
 * @author winnie
 */
@Component
public class TransactionAwareEventListener implements ApplicationListener<TransactionAwareEvent> {

    @Override
    public void onApplicationEvent(TransactionAwareEvent event) {
        try {
            Thread.sleep(100);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
        //TODO: call audit service to proceed
        System.out.println("Time=" + System.currentTimeMillis() + "; Here we assume an audit service is called at this place");
    }
    
}
